<template>
  <el-dialog v-model="showDialog" append-to-body width="min(80% , 600px )" :before-close>
    <table
      border="0"
      cellpadding="0"
      cellspacing="0"
      style="border-collapse: collapse; table-layout: fixed"
    >
      <col width="130" />
      <col width="140" />
      <col width="130" />
      <col width="300" />
      <tr>
        <td class="xl65 item-title" colspan="4">一、基本信息</td>
      </tr>
      <tr>
        <td class="xl66">驻商人员</td>
        <td class="xl67">{{ showingUser }}</td>
        <td class="xl68">驻商单位</td>
        <td class="xl67">{{ showingBusiness }}</td>
      </tr>
      <tr>
        <td class="xl66">开始时间</td>
        <td class="xl69" x:num="45217.">{{ showingDate }}</td>
        <td class="xl70">地市公司</td>
        <td class="xl71">威海分公司</td>
      </tr>
      <tr>
        <td class="xl66">驻场类</td>
        <td class="xl72 item-title" colspan="3">
          {{ showingData.zcType }}
        </td>
      </tr>
      <tr>
        <td class="xl66">工作内容</td>
        <td class="xl71 item-title" colspan="3">
          {{ showingData.workContent }}
        </td>
      </tr>
      <tr>
        <td class="xl73 item-title" colspan="4">二、驻商工作</td>
      </tr>
      <tr>
        <td class="xl74 item-title" colspan="4">（一）信息摸排</td>
      </tr>
      <tr>
        <td class="xl74 item-title" colspan="4">
          <div v-for="(item, index) in showingData.xxmp" :key="index">
            {{ index + 1 }}、
            <span style="color: red" v-if="item.infoType == '重要消息'">[{{ item.infoType }}]</span>
            <span v-else>[{{ item.infoType }}]</span> {{ item.content }}
          </div>
        </td>
      </tr>
      <tr>
        <td class="xl75 item-title" colspan="4">（二）商机跟进</td>
      </tr>
      <tr>
        <td class="xl76 item-title" colspan="4">
          <div v-for="(item, index) in showingData.sjgj" :key="index">
            {{ index + 1 }}、 [{{ item.projectName }}] {{ item.content }}
          </div>
        </td>
      </tr>
      <tr>
        <td class="xl82 item-title" colspan="4">（三）驻商工作</td>
      </tr>
      <tr>
        <td class="xl76 item-title" colspan="4">
          <div v-for="(item, index) in showingData.zsgz" :key="index">
            {{ index + 1 }}、 [{{ item.businessWorkType }}] {{ item.content }}
          </div>
        </td>
      </tr>
    </table>
  </el-dialog>
</template>

<script setup>
import { dateFormat, zcType } from '@/assets/const'
import { ref } from 'vue'
let showDialog = ref(false)
let showingData = ref({})
let showingDate = ref({})
let showingUser = ref('')
let showingBusiness = ref('')

function open(work, name, startDate, businessName) {
  showingUser.value = name
  showingDate.value = startDate
  showingData.value = work
  showingBusiness.value = businessName
  showDialog.value = true
}

function beforeClose(done) {
  showingData.value = {}
  done()
}

defineExpose({
  open
})
</script>

<style lang="less">
td {
  padding: 5pt;
}

.xl65 {
  text-align: justify;
  font-size: 16pt;
  font-weight: 700;
  border: 1pt solid #000000;
}

.xl66 {
  text-align: justify;
  font-weight: 700;
  border-left: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl67 {
  text-align: justify;

  border-top: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl68 {
  text-align: justify;
  font-weight: 700;
  border-top: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl69 {
  text-align: justify;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl70 {
  text-align: justify;
  font-weight: 700;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl71 {
  text-align: justify;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl72 {
  text-align: justify;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl73 {
  text-align: justify;
  font-size: 16pt;
  font-weight: 700;
  border-left: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl74 {
  text-align: justify;
  border-left: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl75 {
  text-align: justify;
  border-left: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl76 {
  text-align: justify;
  border-left: 1pt solid #000000;
}

.xl77 {
  text-align: justify;
}

.xl78 {
  text-align: justify;
  border-right: 1pt solid #000000;
}

.xl80 {
  text-align: justify;
  border-bottom: 1pt solid #000000;
}

.xl81 {
  text-align: justify;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.xl82 {
  text-align: justify;
  white-space: normal;
  border-left: 1pt solid #000000;
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}

.item-title {
  border-right: 1pt solid #000000;
  border-bottom: 1pt solid #000000;
}
</style>
